import request from '@/utils/request2'

// 查询学生寝室关联列表
export function listStuDorRelation(query) {
  return request({
    url: '/stuManage/stuDorRelation/list',
    method: 'get',
    params: query
  })
}

// 查询学生寝室关联详细
export function getStuDorRelation(id) {
  return request({
    url: '/stuManage/stuDorRelation/' + id,
    method: 'get'
  })
}

//同步学生最新寝室变动信息到学生表
export function updateStuLatestDorRelation(stuId) {
  return request({
    url: '/stuManage/stuDorRelation/asyncDorInfo/' + stuId,
    method: 'get'
  })
}

// 新增学生寝室关联
export function addStuDorRelation(data) {
  return request({
    url: '/stuManage/stuDorRelation',
    method: 'post',
    data: data
  })
}

// 修改学生寝室关联
export function updateStuDorRelation(data) {
  return request({
    url: '/stuManage/stuDorRelation',
    method: 'put',
    data: data
  })
}

// 删除学生寝室关联
export function delStuDorRelation(id) {
  return request({
    url: '/stuManage/stuDorRelation/' + id,
    method: 'delete'
  })
}
